package com.conan.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


/**
 * @version 加油！！！
 * @Description
 * @Author 谷藤新一GYC
 * @Date 2022/10/23 - 11:25
 */
@Controller
//@RequestMapping("/hello")
public class RequestMappingController {

    //此时请求映射所映射的请求路径为:/hello/testRequestMapping
    @RequestMapping(
            value = {"/testRequestMapping","/test"},
            method = {RequestMethod.GET,RequestMethod.POST}
    )
    public String success(){

        return "success";
    }

    @GetMapping("/testGetMapping")
    public String testGetMapping(){

        return "success";
    }
    @PutMapping("/testPut")
    public String testPut(){
        return "success";
    }

    @RequestMapping(
            value = "/testParamsAndHanders",
            params = {"username","password=123456"},
            headers = {"Host=localhost:8080"}
    )
    public String testParams(){
        return "success";
    }

    @RequestMapping("/a?a/testAnt")
    public String testAnt(){

        return "success";
    }

    @RequestMapping("/testPath/{id}")
    public String testPath(@PathVariable("id") Integer id){
        System.out.println("id:"+id);
        return "success";
    }
}
   